cmake_minimum_required(VERSION 3.15)
project(control_driver)

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
  set(CMAKE_BUILD_TYPE Release)
endif()

set(CMAKE_CXX_STANDARD 17)

find_package(rclcpp REQUIRED)
find_package(rclpy REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(nav_msgs REQUIRED)

include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}
    src
)

file(GLOB_RECURSE ALL_SRCS "src/*.cpp")

# add_library(controller STATIC ${ALL_SRCS})

add_executable(control_driver src/control_node.cpp ${ALL_SRCS})
ament_target_dependencies(control_driver rclcpp rclpy geometry_msgs nav_msgs)

install(
  DIRECTORY launch
  DESTINATION share/${PROJECT_NAME}/
)

install(
  DIRECTORY config
  DESTINATION share/${PROJECT_NAME}/
)

install(
  TARGETS control_driver
  DESTINATION lib/${PROJECT_NAME}
)

ament_package()